Skip to content

feat(frontend): Support for UDF Ui Parameter#4268

Open
carloea2 wants to merge 17 commits intoapache:mainfrom
carloea2:feat/ui-parameter
Open

feat(frontend): Support for UDF Ui Parameter#4268
carloea2 wants to merge 17 commits intoapache:mainfrom
carloea2:feat/ui-parameter

Conversation

@carloea2
Copy link
Contributor

@carloea2 carloea2 commented Mar 7, 2026

What changes were proposed in this PR?

Add Python UDF Parameter support:
image

What the user writes (Python)

Users declare UI parameters once in open(), and then use the typed value directly:

from pytexera import *
from typing import Iterator, Optional

class ProcessTupleOperator(UDFOperatorV2):

    @overrides
    def open(self):
        # declare UiParameters once, store the parsed runtime values
        self.value1 = self.UiParameter(name="param1", type=AttributeType.DOUBLE).value
        self.value2 = self.UiParameter(name="param2", type=AttributeType.INT).value
        self.value3 = self.UiParameter(name="param3", type=AttributeType.STRING).value
        self.value4 = self.UiParameter(name="param4", type=AttributeType.TIMESTAMP).value

    @overrides
    def process_tuple(self, tuple_: Tuple, port: int) -> Iterator[Optional[TupleLike]]:
        print(self.value1)
        print(self.value2)
        print(self.value3)
        print(self.value4)
        yield tuple_

What shows up in the UI

From those self.UiParameter(...) lines, the property panel automatically generates a Parameters section with one row per parameter:

  • Name + Type are read-only (so they stay consistent with the code)
  • Value is editable (so users can change runtime values without touching the script)

How the values get into Python

When the workflow runs, we inject the UI values into the UDF and the base class applies them right before open() executes. That way, when the user calls UiParameter(...).value, they get the current value from the UI.

Any related issues, documentation, discussions?

Closes #4154

How was this PR tested?

Testing added to backend and frontend

Was this PR authored or co-authored using generative AI tooling?

Co-generated with GPT

@github-actions github-actions bot added feature engine python frontend Changes related to the frontend GUI common labels Mar 7, 2026
@carloea2 carloea2 changed the title Feat/UI parameter feat(frontend): Support for UDF Ui Parameter Mar 7, 2026
@chenlica chenlica requested a review from aglinxinyuan March 7, 2026 16:06
@chenlica
Copy link
Contributor

chenlica commented Mar 7, 2026

@aglinxinyuan Please review it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

common engine feature frontend Changes related to the frontend GUI python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants